//
//  STSportingChangeMapTypeViewController.m
//  STBest
//
//  Created by apple on 2017/8/29.
//  Copyright © 2017年 apple. All rights reserved.
//

#import "STSportingChangeMapTypeViewController.h"


@interface STSportingChangeMapTypeViewController ()
@property (weak, nonatomic) IBOutlet UIButton *statndardButton;
@property (weak, nonatomic) IBOutlet UIButton *standarNightButton;
@property (weak, nonatomic) IBOutlet UIButton *satelliteButton;

@end

@implementation STSportingChangeMapTypeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self refreshUIWithType:self.type];
}

- (void)refreshUIWithType:(MAMapType)type{
    
    self.statndardButton.selected = NO;
    self.satelliteButton.selected = NO;
    self.standarNightButton.selected = NO;
    
    switch (type) {
        case MAMapTypeStandard:
            self.statndardButton.selected = YES;
            break;
        case MAMapTypeSatellite:
            self.satelliteButton.selected = YES;
            break;
            
        case MAMapTypeStandardNight:
            self.standarNightButton.selected = YES;
            break;
            
        default:
            break;
    }

    
}
- (IBAction)actionChangeMapType:(id)sender {
    
    self.type = [sender tag];
    [self refreshUIWithType:self.type];
    if(self.completedBlock) self.completedBlock(self.type);
}



@end
